<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../../JS/common.js"></script>
		<script type="text/javascript" src="../../../JS/SHA-1.js"></script>
	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:600px;">
			<div data-options="region:'center'">
				<div>
					<table id="dg" class="table_style">
					</table>
				</div>
			</div>
		</div>
		<div id="toolbar"></div>
		<div id="dlg" class="hiddenDialog">
			<iframe id="ifrmEdit" style="width: 100%;height: 100%;" frameborder="0" scrolling="no"></iframe>
		</div>
	</body>
	<script>
		var currid = getMultiID();
		var listUrl="";
		if(currid!=undefined)
		{
			listUrl=RemoteLinkAddress+"/market/violation/listbytenant.do?"+constructSpecialCondition(currid);
		}
		else
		{
			listUrl=RemoteLinkAddress + "/market/violation/list.do";
		}
		var content = "";
		
		content = AddToolBar(3);
		$("#toolbar").append(content);
		
		var auth = "admin;" + hex_sha1("admin1");
		
		function newdata() {  //新增
			AddTabIn("事件新增", parent.parent.$('#tabs'), "UI/Market/PeccancyEventManagement/PeccancyEventManagementAdd.html?id=-1");
		}

		function editdata() {  //编辑
			var pLocation = "";
			var row = $('#dg').datagrid('getSelected');
			if(!row) {
				$.messager.alert('Info', "请选择你需要修改数据"); 
				return;
			}
			AddTabIn("违章事件单据修改", parent.parent.$('#tabs'), "UI/Market/PeccancyEventManagement/PeccancyEventManagementAdd.html?id=" + row.ID);
		}

		$('#dg').datagrid({
			url: listUrl,
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			fitColumns: 'false',
			rownumbers: 'true',
			singleSelect: 'true',
			height: 350,
			columns: [
				[{
					field:'ID',
					title:'ID',
					width:'1%',
					align:'center'
				},{
					field: 'ORDER_NO',
					title: '违章编号',
					width: '10%',
					align: 'center'
				}, {
					field: 'TENANT_ID',
					title: '商户编号',
					width: '1%',
					align: 'center'
				}, {
					field: 'TIME',
					title: '违章时间',
					width: '25%',
					align: 'center'
				}, {
					field: 'REASONS',
					title: '违章事由',
					width: '27%',
					align: 'center'
				},{
					field: 'OPERATOR',
					title: '经办人',
					width: '24%',
					align: 'center'
				},{
					field: 'ISVERIFY',
					title: '是否审核',
					width: '10%',
					align: 'center',
					formatter: function(value, row, index) {
							return verifyStatus(value,false);
						}
				}]
			],
			onDblClickRow: function(index, row) {
				var pLocation = "";
				pLocation = "UI/Market/PeccancyEventManagement/PeccancyEventManagementAdd.html?id=" + row.ID; 
				AddTabIn("事件详情",parent.parent.$("#tabs"), pLocation);
			}
		});

        $('#dg').datagrid('hideColumn','ID'); 
		$('#dg').datagrid('hideColumn', 'TENANT_ID');
		
	</script>

</html>